package com.hakim.wfb.admin.service.impl;

import com.hakim.wfb.admin.params.user.PwdRestParam;
import com.hakim.wfb.admin.service.api.CustomerService;
import com.hakim.wfb.dao.UserDao;
import com.hkfs.fundamental.api.data.ResultEx;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by lenovo on 2017/7/29.
 */
@Service("customerService")
public class CustomerServiceImpl implements CustomerService {

    @Autowired
    private UserDao userDao;

    @Override
    public ResultEx pwdReset(PwdRestParam param) {
        ResultEx er = new ResultEx();
        try {
            if (param.getPwdType().equalsIgnoreCase("1"))
                userDao.resetLogPwd(param.getUserId());
            else
                userDao.restTranPwd(param.getUserId());

        } catch (Exception e) {
            return er.makeFailedResult("操作失败");
        }
        return er.makeSuccessResult();
    }
}
